<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.18"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>HElib: /HElib/include/helib/CtPtrs.h Source File</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
		<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;1,700&family=Merriweather&family=Merriweather+Sans&family=Open+Sans&family=Poppins:ital@1&family=Roboto:ital,wght@0,400;1,300;1,900&display=swap" rel="stylesheet"> 
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body style="font-family: 'Merriweather', serif;">
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand">HElib Implementing Homomorphic Encryption</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_d0c4ae63660968bf6b1c77a1e8aecf95.html">helib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">CtPtrs.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_ct_ptrs_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* Copyright (C) 2012-2020 IBM Corp.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This program is Licensed under the Apache License, Version 2.0</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * with the License. You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *   http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * limitations under the License. See accompanying LICENSE file.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#ifndef HELIB_CTPTRS_H</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#define HELIB_CTPTRS_H</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;initializer_list&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_ctxt_8h.html">helib/Ctxt.h</a>&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_ptr_vector_8h.html">helib/PtrVector.h</a>&gt;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_ptr_matrix_8h.html">helib/PtrMatrix.h</a>&gt;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacehelib.html">helib</a> {</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="namespacehelib.html#afac4e5ae4b272f9ffd07daee26285dad">   25</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhelib_1_1_ptr_vector.html">PtrVector&lt;Ctxt&gt;</a> <a class="code" href="namespacehelib.html#afac4e5ae4b272f9ffd07daee26285dad">CtPtrs</a>;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment">// CtPtrs_VecCt(NTL::Vec&lt;Ctxt&gt;)</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="namespacehelib.html#a68bdc610c69d2325ae28b53783225701">   27</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhelib_1_1_ptr_vector___vec_t.html">PtrVector_VecT&lt;Ctxt&gt;</a> <a class="code" href="namespacehelib.html#a68bdc610c69d2325ae28b53783225701">CtPtrs_VecCt</a>;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment">// CtPtrs_vectorCt(std::vector&lt;Ctxt&gt;)</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="namespacehelib.html#a70957f911bb89f6b84e7838ac4363d07">   29</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhelib_1_1_ptr_vector__vector_t.html">PtrVector_vectorT&lt;Ctxt&gt;</a> <a class="code" href="namespacehelib.html#a70957f911bb89f6b84e7838ac4363d07">CtPtrs_vectorCt</a>;</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment">// CtPtrs_VecPt(NTL::Vec&lt;Ctxt*&gt;)</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="namespacehelib.html#adf611a971d91604083e4a4f4d2745a46">   31</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhelib_1_1_ptr_vector___vec_pt.html">PtrVector_VecPt&lt;Ctxt&gt;</a> <a class="code" href="namespacehelib.html#adf611a971d91604083e4a4f4d2745a46">CtPtrs_VecPt</a>;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">// CtPtrs_vectorPt(std::vector&lt;Ctxt*&gt;)</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="namespacehelib.html#ac9e2fec60563f1741cf5b38e9c975781">   33</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhelib_1_1_ptr_vector__vector_pt.html">PtrVector_vectorPt&lt;Ctxt&gt;</a> <a class="code" href="namespacehelib.html#ac9e2fec60563f1741cf5b38e9c975781">CtPtrs_vectorPt</a>;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment">// A slice of CtPtrs</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="namespacehelib.html#afddae64ffeb6698a0b2a5214ab66273b">   36</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhelib_1_1_ptr_vector__slice.html">PtrVector_slice&lt;Ctxt&gt;</a> <a class="code" href="namespacehelib.html#afddae64ffeb6698a0b2a5214ab66273b">CtPtrs_slice</a>;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="namespacehelib.html#ac54132076174cf5388da4f1121f4d417">   38</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhelib_1_1_ptr_matrix.html">PtrMatrix&lt;Ctxt&gt;</a> <a class="code" href="namespacehelib.html#ac54132076174cf5388da4f1121f4d417">CtPtrMat</a>;</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="namespacehelib.html#a536b3dcc07d9bee58c6f52f62118cd53">   39</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhelib_1_1_ptr_matrix___vec.html">PtrMatrix_Vec&lt;Ctxt&gt;</a> <a class="code" href="namespacehelib.html#a536b3dcc07d9bee58c6f52f62118cd53">CtPtrMat_VecCt</a>;</div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="namespacehelib.html#a2f951b4c929a807f0a369b1aed560c6a">   40</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhelib_1_1_ptr_matrix__vector.html">PtrMatrix_vector&lt;Ctxt&gt;</a> <a class="code" href="namespacehelib.html#a2f951b4c929a807f0a369b1aed560c6a">CtPtrMat_vectorCt</a>;</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="namespacehelib.html#a3985a932f1b51600445c078fc5531d19">   41</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhelib_1_1_ptr_matrix__pt_vec.html">PtrMatrix_ptVec&lt;Ctxt&gt;</a> <a class="code" href="namespacehelib.html#a3985a932f1b51600445c078fc5531d19">CtPtrMat_ptVecCt</a>;</div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="namespacehelib.html#a2417782a109df301d765fbcdfe6ac1b7">   42</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhelib_1_1_ptr_matrix__ptvector.html">PtrMatrix_ptvector&lt;Ctxt&gt;</a> <a class="code" href="namespacehelib.html#a2417782a109df301d765fbcdfe6ac1b7">CtPtrMat_ptvectorCt</a>;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment">// Use packed bootstrapping, so we can bootstrap all in just a few calls</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacehelib.html#aea4d00f74735017eb674bc25cca0d47d">packedRecrypt</a>(<span class="keyword">const</span> <a class="code" href="structhelib_1_1_ptr_vector.html">CtPtrs</a>&amp; cPtrs,</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;                   <span class="keyword">const</span> std::vector&lt;zzX&gt;&amp; unpackConsts,</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;                   <span class="keyword">const</span> <a class="code" href="classhelib_1_1_encrypted_array.html">EncryptedArray</a>&amp; ea);</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment">// recrypt all ctxt below level &#39;belowLvl&#39;</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacehelib.html#aea4d00f74735017eb674bc25cca0d47d">packedRecrypt</a>(<span class="keyword">const</span> <a class="code" href="structhelib_1_1_ptr_vector.html">CtPtrs</a>&amp; array, <span class="comment">// vector of Ctxts</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;                   <span class="keyword">const</span> std::vector&lt;zzX&gt;&amp; unpackConsts,</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;                   <span class="keyword">const</span> <a class="code" href="classhelib_1_1_encrypted_array.html">EncryptedArray</a>&amp; ea,</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;                   <span class="keywordtype">long</span> belowLvl);</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacehelib.html#aea4d00f74735017eb674bc25cca0d47d">packedRecrypt</a>(<span class="keyword">const</span> <a class="code" href="structhelib_1_1_ptr_matrix.html">CtPtrMat</a>&amp; m, <span class="comment">// matrix of Ctxts</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;                   <span class="keyword">const</span> std::vector&lt;zzX&gt;&amp; unpackConsts,</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;                   <span class="keyword">const</span> <a class="code" href="classhelib_1_1_encrypted_array.html">EncryptedArray</a>&amp; ea,</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;                   <span class="keywordtype">long</span> belowLvl = LONG_MAX);</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="comment">// Find the lowest level among many ciphertexts</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="comment">// FIXME: using bitCapacity isn&#39;t really the right thing...</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment">// this could break some code</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="namespacehelib.html#a3f5129e7d3dfa1e3c31cf5df21ae581d">   62</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">long</span> <a class="code" href="namespacehelib.html#a3f5129e7d3dfa1e3c31cf5df21ae581d">findMinBitCapacity</a>(<span class="keyword">const</span> <a class="code" href="structhelib_1_1_ptr_vector.html">CtPtrs</a>&amp; v)</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;{</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  <span class="keywordtype">long</span> lvl = LONG_MAX;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">long</span> i = 0; i &lt; v.<a class="code" href="structhelib_1_1_ptr_vector.html#a1791944a5b25238b009597d88e83bc13">size</a>(); i++)</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keywordflow">if</span> (v.<a class="code" href="structhelib_1_1_ptr_vector.html#afdc2a14a65d1d9e38cc95721ed245fd9">isSet</a>(i) &amp;&amp; !v[i]-&gt;isEmpty())</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;      lvl = std::min(lvl, v[i]-&gt;bitCapacity());</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;  <span class="keywordflow">return</span> lvl;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;}</div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="namespacehelib.html#a57538912bfe96e264dab8aac85f0be75">   70</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">long</span> <a class="code" href="namespacehelib.html#a3f5129e7d3dfa1e3c31cf5df21ae581d">findMinBitCapacity</a>(<span class="keyword">const</span> <a class="code" href="structhelib_1_1_ptr_matrix.html">CtPtrMat</a>&amp; m)</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;{</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  <span class="keywordtype">long</span> lvl = LONG_MAX;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">long</span> i = 0; i &lt; m.<a class="code" href="structhelib_1_1_ptr_matrix.html#a939ee2ea94472a63d762b00182a46d27">size</a>(); i++)</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    lvl = std::min(lvl, <a class="code" href="namespacehelib.html#a3f5129e7d3dfa1e3c31cf5df21ae581d">findMinBitCapacity</a>(m[i]));</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  <span class="keywordflow">return</span> lvl;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;}</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="namespacehelib.html#a544c38d5177ea1f1d47d3e204ac1eb77">   78</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">long</span> <a class="code" href="namespacehelib.html#a3f5129e7d3dfa1e3c31cf5df21ae581d">findMinBitCapacity</a>(std::initializer_list&lt;const CtPtrs*&gt; list)</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;{</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  <span class="keywordtype">long</span> lvl = LONG_MAX;</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  <span class="keywordflow">for</span> (<span class="keyword">auto</span> elem : list)</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    lvl = std::min(lvl, <a class="code" href="namespacehelib.html#a3f5129e7d3dfa1e3c31cf5df21ae581d">findMinBitCapacity</a>(*elem));</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;  <span class="keywordflow">return</span> lvl;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;}</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacehelib.html#a391719dad458fcb9560406cb565f8cbe">innerProduct</a>(Ctxt&amp; result, <span class="keyword">const</span> <a class="code" href="namespacehelib.html#afac4e5ae4b272f9ffd07daee26285dad">CtPtrs</a>&amp; v1, <span class="keyword">const</span> <a class="code" href="namespacehelib.html#afac4e5ae4b272f9ffd07daee26285dad">CtPtrs</a>&amp; v2);</div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="namespacehelib.html#aa1e7877c8a04ea75594a2295518c70d8">   87</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a> <a class="code" href="namespacehelib.html#a391719dad458fcb9560406cb565f8cbe">innerProduct</a>(<span class="keyword">const</span> <a class="code" href="structhelib_1_1_ptr_vector.html">CtPtrs</a>&amp; v1, <span class="keyword">const</span> <a class="code" href="structhelib_1_1_ptr_vector.html">CtPtrs</a>&amp; v2)</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;{</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a> ret(ZeroCtxtLike, *v1[0]);</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  <a class="code" href="namespacehelib.html#a391719dad458fcb9560406cb565f8cbe">innerProduct</a>(ret, v1, v2);</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;  <span class="keywordflow">return</span> ret;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;}</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160; </div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;} <span class="comment">// namespace helib</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="preprocessor">#endif // ifndef HELIB_CTPTRS_H</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="a_ptr_matrix_8h_html"><div class="ttname"><a href="_ptr_matrix_8h.html">PtrMatrix.h</a></div><div class="ttdoc">Convenience class templates providing a unified interface for a matrix of objects,...</div></div>
<div class="ttc" id="anamespacehelib_html_a536b3dcc07d9bee58c6f52f62118cd53"><div class="ttname"><a href="namespacehelib.html#a536b3dcc07d9bee58c6f52f62118cd53">helib::CtPtrMat_VecCt</a></div><div class="ttdeci">PtrMatrix_Vec&lt; Ctxt &gt; CtPtrMat_VecCt</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:39</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_matrix__vector_html"><div class="ttname"><a href="structhelib_1_1_ptr_matrix__vector.html">helib::PtrMatrix_vector</a></div><div class="ttdoc">An implementation of PtrMatrix using vector&lt; vector&lt;T&gt; &gt;</div><div class="ttdef"><b>Definition:</b> PtrMatrix.h:167</div></div>
<div class="ttc" id="anamespacehelib_html_a2f951b4c929a807f0a369b1aed560c6a"><div class="ttname"><a href="namespacehelib.html#a2f951b4c929a807f0a369b1aed560c6a">helib::CtPtrMat_vectorCt</a></div><div class="ttdeci">PtrMatrix_vector&lt; Ctxt &gt; CtPtrMat_vectorCt</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:40</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_matrix_html"><div class="ttname"><a href="structhelib_1_1_ptr_matrix.html">helib::PtrMatrix</a></div><div class="ttdoc">An abstract class for an array of PtrVectors.</div><div class="ttdef"><b>Definition:</b> PtrMatrix.h:27</div></div>
<div class="ttc" id="anamespacehelib_html_a3985a932f1b51600445c078fc5531d19"><div class="ttname"><a href="namespacehelib.html#a3985a932f1b51600445c078fc5531d19">helib::CtPtrMat_ptVecCt</a></div><div class="ttdeci">PtrMatrix_ptVec&lt; Ctxt &gt; CtPtrMat_ptVecCt</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:41</div></div>
<div class="ttc" id="anamespacehelib_html_ac54132076174cf5388da4f1121f4d417"><div class="ttname"><a href="namespacehelib.html#ac54132076174cf5388da4f1121f4d417">helib::CtPtrMat</a></div><div class="ttdeci">PtrMatrix&lt; Ctxt &gt; CtPtrMat</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:38</div></div>
<div class="ttc" id="anamespacehelib_html_a2417782a109df301d765fbcdfe6ac1b7"><div class="ttname"><a href="namespacehelib.html#a2417782a109df301d765fbcdfe6ac1b7">helib::CtPtrMat_ptvectorCt</a></div><div class="ttdeci">PtrMatrix_ptvector&lt; Ctxt &gt; CtPtrMat_ptvectorCt</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:42</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_matrix__pt_vec_html"><div class="ttname"><a href="structhelib_1_1_ptr_matrix__pt_vec.html">helib::PtrMatrix_ptVec</a></div><div class="ttdoc">An implementation of PtrMatrix using Vec&lt; Vec&lt;T&gt;* &gt;</div><div class="ttdef"><b>Definition:</b> PtrMatrix.h:141</div></div>
<div class="ttc" id="aclasshelib_1_1_encrypted_array_html"><div class="ttname"><a href="classhelib_1_1_encrypted_array.html">helib::EncryptedArray</a></div><div class="ttdoc">A simple wrapper for a smart pointer to an EncryptedArrayBase. This is the interface that higher-leve...</div><div class="ttdef"><b>Definition:</b> EncryptedArray.h:1237</div></div>
<div class="ttc" id="anamespacehelib_html_a70957f911bb89f6b84e7838ac4363d07"><div class="ttname"><a href="namespacehelib.html#a70957f911bb89f6b84e7838ac4363d07">helib::CtPtrs_vectorCt</a></div><div class="ttdeci">PtrVector_vectorT&lt; Ctxt &gt; CtPtrs_vectorCt</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:29</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_matrix___vec_html"><div class="ttname"><a href="structhelib_1_1_ptr_matrix___vec.html">helib::PtrMatrix_Vec</a></div><div class="ttdoc">An implementation of PtrMatrix using Vec&lt; Vec&lt;T&gt; &gt;</div><div class="ttdef"><b>Definition:</b> PtrMatrix.h:97</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_vector___vec_t_html"><div class="ttname"><a href="structhelib_1_1_ptr_vector___vec_t.html">helib::PtrVector_VecT</a></div><div class="ttdoc">An implementation of PtrVector using Vec&lt;T&gt;</div><div class="ttdef"><b>Definition:</b> PtrVector.h:208</div></div>
<div class="ttc" id="anamespacehelib_html_afddae64ffeb6698a0b2a5214ab66273b"><div class="ttname"><a href="namespacehelib.html#afddae64ffeb6698a0b2a5214ab66273b">helib::CtPtrs_slice</a></div><div class="ttdeci">PtrVector_slice&lt; Ctxt &gt; CtPtrs_slice</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:36</div></div>
<div class="ttc" id="anamespacehelib_html_adf611a971d91604083e4a4f4d2745a46"><div class="ttname"><a href="namespacehelib.html#adf611a971d91604083e4a4f4d2745a46">helib::CtPtrs_VecPt</a></div><div class="ttdeci">PtrVector_VecPt&lt; Ctxt &gt; CtPtrs_VecPt</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:31</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_vector__vector_pt_html"><div class="ttname"><a href="structhelib_1_1_ptr_vector__vector_pt.html">helib::PtrVector_vectorPt</a></div><div class="ttdoc">An implementation of PtrVector using vector&lt;T*&gt;</div><div class="ttdef"><b>Definition:</b> PtrVector.h:192</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_vector_html_a1791944a5b25238b009597d88e83bc13"><div class="ttname"><a href="structhelib_1_1_ptr_vector.html#a1791944a5b25238b009597d88e83bc13">helib::PtrVector::size</a></div><div class="ttdeci">virtual long size() const =0</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_matrix_html_a939ee2ea94472a63d762b00182a46d27"><div class="ttname"><a href="structhelib_1_1_ptr_matrix.html#a939ee2ea94472a63d762b00182a46d27">helib::PtrMatrix::size</a></div><div class="ttdeci">virtual long size() const =0</div></div>
<div class="ttc" id="anamespacehelib_html_ac9e2fec60563f1741cf5b38e9c975781"><div class="ttname"><a href="namespacehelib.html#ac9e2fec60563f1741cf5b38e9c975781">helib::CtPtrs_vectorPt</a></div><div class="ttdeci">PtrVector_vectorPt&lt; Ctxt &gt; CtPtrs_vectorPt</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:33</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_vector_html"><div class="ttname"><a href="structhelib_1_1_ptr_vector.html">helib::PtrVector</a></div><div class="ttdoc">Abstract class for an array of objects.</div><div class="ttdef"><b>Definition:</b> PtrVector.h:32</div></div>
<div class="ttc" id="anamespacehelib_html_a391719dad458fcb9560406cb565f8cbe"><div class="ttname"><a href="namespacehelib.html#a391719dad458fcb9560406cb565f8cbe">helib::innerProduct</a></div><div class="ttdeci">void innerProduct(Ctxt &amp;result, const CtPtrs &amp;v1, const CtPtrs &amp;v2)</div><div class="ttdef"><b>Definition:</b> Ctxt.cpp:1994</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_matrix__ptvector_html"><div class="ttname"><a href="structhelib_1_1_ptr_matrix__ptvector.html">helib::PtrMatrix_ptvector</a></div><div class="ttdoc">An implementation of PtrMatrix using vector&lt; vector&lt;T&gt;* &gt;</div><div class="ttdef"><b>Definition:</b> PtrMatrix.h:210</div></div>
<div class="ttc" id="anamespacehelib_html"><div class="ttname"><a href="namespacehelib.html">helib</a></div><div class="ttdef"><b>Definition:</b> apiAttributes.h:21</div></div>
<div class="ttc" id="a_ctxt_8h_html"><div class="ttname"><a href="_ctxt_8h.html">Ctxt.h</a></div><div class="ttdoc">Declarations of a BGV-type ciphertext and key-switching matrices.</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_vector_html_afdc2a14a65d1d9e38cc95721ed245fd9"><div class="ttname"><a href="structhelib_1_1_ptr_vector.html#afdc2a14a65d1d9e38cc95721ed245fd9">helib::PtrVector::isSet</a></div><div class="ttdeci">bool isSet(long i) const</div><div class="ttdef"><b>Definition:</b> PtrVector.h:44</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_vector__slice_html"><div class="ttname"><a href="structhelib_1_1_ptr_vector__slice.html">helib::PtrVector_slice</a></div><div class="ttdoc">An implementation of PtrVector as a slice of another PtrVector.</div><div class="ttdef"><b>Definition:</b> PtrVector.h:277</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_vector__vector_t_html"><div class="ttname"><a href="structhelib_1_1_ptr_vector__vector_t.html">helib::PtrVector_vectorT</a></div><div class="ttdoc">An implementation of PtrVector using vector&lt;T&gt;</div><div class="ttdef"><b>Definition:</b> PtrVector.h:245</div></div>
<div class="ttc" id="a_ptr_vector_8h_html"><div class="ttname"><a href="_ptr_vector_8h.html">PtrVector.h</a></div><div class="ttdoc">Convenience class templates providing a unified interface for a collection of objects,...</div></div>
<div class="ttc" id="astructhelib_1_1_ptr_vector___vec_pt_html"><div class="ttname"><a href="structhelib_1_1_ptr_vector___vec_pt.html">helib::PtrVector_VecPt</a></div><div class="ttdoc">An implementation of PtrVector using Vec&lt;T*&gt;</div><div class="ttdef"><b>Definition:</b> PtrVector.h:176</div></div>
<div class="ttc" id="anamespacehelib_html_afac4e5ae4b272f9ffd07daee26285dad"><div class="ttname"><a href="namespacehelib.html#afac4e5ae4b272f9ffd07daee26285dad">helib::CtPtrs</a></div><div class="ttdeci">PtrVector&lt; Ctxt &gt; CtPtrs</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:25</div></div>
<div class="ttc" id="aclasshelib_1_1_ctxt_html"><div class="ttname"><a href="classhelib_1_1_ctxt.html">helib::Ctxt</a></div><div class="ttdoc">A Ctxt object holds a single ciphertext.</div><div class="ttdef"><b>Definition:</b> Ctxt.h:270</div></div>
<div class="ttc" id="anamespacehelib_html_aea4d00f74735017eb674bc25cca0d47d"><div class="ttname"><a href="namespacehelib.html#aea4d00f74735017eb674bc25cca0d47d">helib::packedRecrypt</a></div><div class="ttdeci">void packedRecrypt(const CtPtrs &amp;a, const CtPtrs &amp;b, std::vector&lt; zzX &gt; *unpackSlotEncoding)</div><div class="ttdoc">Function for packed recryption to recrypt multiple numbers.</div><div class="ttdef"><b>Definition:</b> binaryArith.cpp:461</div></div>
<div class="ttc" id="anamespacehelib_html_a68bdc610c69d2325ae28b53783225701"><div class="ttname"><a href="namespacehelib.html#a68bdc610c69d2325ae28b53783225701">helib::CtPtrs_VecCt</a></div><div class="ttdeci">PtrVector_VecT&lt; Ctxt &gt; CtPtrs_VecCt</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:27</div></div>
<div class="ttc" id="anamespacehelib_html_a3f5129e7d3dfa1e3c31cf5df21ae581d"><div class="ttname"><a href="namespacehelib.html#a3f5129e7d3dfa1e3c31cf5df21ae581d">helib::findMinBitCapacity</a></div><div class="ttdeci">long findMinBitCapacity(const CtPtrs &amp;v)</div><div class="ttdef"><b>Definition:</b> CtPtrs.h:62</div></div>
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
        <script type="text/javascript" src="doxy-boot.js"></script>
</html>
